import { defHttp } from "@/utils/http";

// ERP 资产维修申请 VO
export interface PropertyMtnappliedVO {
	applyId: number; // 维修申请ID
	deptId: string; // 使用科室ID
	userId: string; // 使用人ID
	mtnId: string; // 维修人ID
	confirmDtime: string; // 验收人时间
	confirmId: string; // 验收人ID
	sqNumb: number; // 顺序号
	description: string; // 申请描述
	leaderSugge: string; // 领导意见
	mtnProgre: string; // 维修进度
	processId: string; // 流程实例ID
}

// ERP 资产维修申请 API
export const PropertyMtnappliedApi = {
	// 查询资产维修申请分页
	getPropertyMtnappliedPage: async (params: any) => {
		return await defHttp.get({ url: `/whs/asm-mtnapplied/page`, params });
	},

	// 查询资产维修申请详情
	getPropertyMtnapplied: async (id: number) => {
		return await defHttp.get({ url: `/whs/asm-mtnapplied/get?id=` + id });
	},

	// 新增资产维修申请
	createPropertyMtnapplied: async (data: PropertyMtnappliedVO) => {
		return await defHttp.post({ url: `/whs/asm-mtnapplied/create`, data });
	},

	// 修改资产维修申请
	updatePropertyMtnapplied: async (data: PropertyMtnappliedVO) => {
		return await defHttp.put({ url: `/whs/asm-mtnapplied/update`, data });
	},

	// 删除资产维修申请
	deletePropertyMtnapplied: async (id: number) => {
		return await defHttp.delete({
			url: `/whs/asm-mtnapplied/delete?id=` + id
		});
	},

	// 导出资产维修申请 Excel
	exportPropertyMtnapplied: async (params: any) => {
		return await defHttp.download({ url: `/whs/asm-mtnapplied/export-excel`, params });
	}
};
